package com.wlcj.www.enumtype;

public enum EscrowEnum {
	
	YHZJTG(1, "用户资金托管"),
	FXZBJTG(2, "风险准备金托管"),
	WTG(3, "无托管");
	private int code;
	private String desc;
	private EscrowEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static EscrowEnum getEnumByCode(int code) {
		for(EscrowEnum enumtype:values()) {
			if(code==enumtype.getCode())
				return enumtype;
		}
		return null;
	}
	
	public static EscrowEnum getEnumByDesc(String desc) {
		for(EscrowEnum enumtype:values()) {
			if(desc.equals(enumtype.getDesc()))
				return enumtype;
		}
		return null;
	}

}
